<div class="article">
	<div class="articlehead">
		<div class="articledetailhead">
    		<div class="publishdate">{$article.date_text}</div>
    		<a href="#comments">
    			<div class="commentcount">
    				{if $commentList|@count == 0}
    					{$TEXT_COMMENTCOUNT0}
    				{/if}

    				{if $commentList|@count == 1}
    					{$TEXT_COMMENTCOUNT1}
    				{/if}

    				{if $commentList|@count > 1}
    					{$commentList|@count} {$TEXT_COMMENTCOUNT}
    				{/if}
    			</div>
    		</a>
    	</div>
        <h1>{$article.title}</h1>
	</div>

	<div class="articlegoogleplusone"><div class="g-plusone" data-size="medium"></div></div>
	<iframe class="articlefacebooklike" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2F{$primary_domain}%2F{$article.url}.html&layout=standard&action=like&show_faces=true&share=false&height=30&appId=138524109534751"></iframe>
	
	<div id="articlebody" class="articlebody">
		<!-- Below article title -->
		<div class="articleflexad">
			<ins class="adsbygoogle"	
			     style="display:block"
			     data-ad-client="ca-pub-1779872529656954"
			     data-ad-slot="4803413441"
			     data-ad-format="auto"></ins>
			<script>
			(adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>

		{$article.formatted_body|stripslashes}

		<div id="whatsappbuttoncontainer">
			<a href="WhatsApp://send?text={$article.title}: http://{$primary_domain}/{$article.url}.html" id="whatsapplink">
				<div id="whatsappbutton">
					<div id="whatsappbuttonicon"></div>
					{$TEXT_SENDWHATSAPP}
				</div>
			</a>
		</div>

		<span class="dontprint">
		{if $bookOffers|count > 0}
			{assign var="bookOfferTextFile" value='themes/default/lang/'|cat:$languageCode}
			{assign var="bookOfferTextFile" value=$bookOfferTextFile|cat:'/bookoffer-text.tpl'}
			{include file=$bookOfferTextFile}
		{/if}

		{if $recommendationList|@count > 1}
			<h2>{$TEXT_ALSO_READ_HEAD}</h2>
			{$TEXT_ALSO_INTERESTED}
			<div class="recommendlist">
			{assign var="recommendationViewCount" value=0}
			{assign var="recommendationCount" value=0}
			{foreach from=$recommendationList item=recommendationItem}
				{if $recommendationItem.url!=$article.url && $recommendationCount < 6}
					{assign var="recommendationViewCount" value=$recommendationViewCount+$recommendationItem.views}
				{/if}
			{/foreach}
			
			{assign var="recommendationCount" value=0}
			{foreach from=$recommendationList item=recommendationItem}
				{if $recommendationItem.url!=$article.url && $recommendationCount < 6}
					{assign var="recommendationCount" value=$recommendationCount+1}
					{assign var="recommendationView" value=($recommendationItem.views / $recommendationViewCount)*100}

					{assign var="recommendationRating" value=10}
					{if $recommendationView >= 5}
						{assign var="recommendationRating" value="25"}
					{/if}
					{if $recommendationView >= 10}
						{assign var="recommendationRating" value="50"}
					{/if}
					{if $recommendationView >= 15}
						{assign var="recommendationRating" value="75"}
					{/if}
					{if $recommendationView >= 20}
						{assign var="recommendationRating" value="100"}
					{/if}

					<div class="recommenditem" onclick="location.href='/{$recommendationItem.url}.html';">
					  <div class="recommendbox">
					  	{if {$recommendationItem.image} != ""}
					    	<div class="recommendboximage" style="background-image:url('/img/{$recommendationItem.previewimage}');"></div>
					    {else}
					    	<div class="recommendboximage"></div>
					    {/if}
					  </div>
					  <div class="recommendtitle">
					    <a href="/{$recommendationItem.url}.html">{$recommendationItem.title}</a>
					  </div>
					  <div class="buttonlink">{$TEXT_READ_ARTICLE} &raquo;</div>
					  <div class="recommendstats">
					    {$recommendationItem.views} {$TEXT_VISITORS_ALSO_READ}
					  </div>
					</div>
				{/if}
			{/foreach}
			</div>
		{/if}
		</span>

		<a name="comments"></a>
		<h2>{$TEXT_COMMENT_TITLE} &bdquo;{$article.title}&ldquo;</h2>
		{if $languageCode == "de-DE"}
			Wenn Du möchtest, kannst Du hier Kommentare zum Thema hinterlassen und Dich mit anderen Nutzern austauschen. Damit Du kommentieren kannst, musst Du Dich nur anmelden und schon kann es losgehen.
		{/if}

		{if $languageCode == "en-GB"}
			If you like you can leave a comment about the topic and exchange with other reads. In order to comment you need to login and then you can start immediately.
		{/if}
	</div>
	<div class="commentlist">
		{assign var=commentnum value=1}
		{foreach from=$commentList item=commentItem}
			<a name="comment{$commentnum}"></a>
			<div class="commententry">
				<div class="commententrydetail">
					<div class="commentauthorimage" style="background-image:url('/userimage/{$commentItem.user_extid}.jpg');"></div>

					<div class="commentauthorname">
						<a target="_blank" href="{$commentItem.user_profileurl}">
							{$commentItem.user_name}
						</a> 
					</div>
					<div class="commentdate">
						{$commentItem.date|date_format:"%d.%m.%Y %H:%M"}
					</div>
				</div>
				<div class="commententrytext">
					{$commentItem.text}

					{if $loggedIn == true}
						{if $user.is_admin == true || $user.externalid == $commentItem.user_extid}
							<!-- admins and owners can delete comment -->
							<div id="commententrydelete_{$commentItem.id}" class="commententrydelete">
								<a id="deletecommentlink_{$commentItem.id}" class="deletecommentlink">
									{$TEXT_DELETE_COMMENT}
								</a>
							</div>
							<div id="commententryconfirmdelete_{$commentItem.id}" class="commententryconfirmdelete">
								{$TEXT_REALLY_DELETE_COMMENT}<br /> 
								<a id="deletecommentconfirmlink_{$commentItem.id}" class="deletecommentconfirmlink">
									&raquo; {$TEXT_CONFIRM_DELETE_COMMENT}
								</a>
							</div>
						{/if}
					{/if}
				</div>
				<div style="clear:both;"></div>
			</div>
			{assign var=commentnum value=$commentnum+1}
		{/foreach}

		{if $loggedIn == true}
			<div class="commententry dontprint">
				<div class="commententrydetail">
					<div class="commentauthorimage" style="background-image:url('/userimage/{$user.externalid}.jpg');"></div>

					<div class="commentauthorname">
						<a target="_blank" href="{$user.profileurl}">
							{$user.realname}
						</a> 
					</div>
				</div>
				<div class="commententrytext">
					<form id="submitcommentform" method="post" action="#comments">
						<textarea id="newcommenttext" name="comment">{$TEXT_WRITENEWCOMMENT}...</textarea>
					</form>
				</div>
				<div id="submitcommentbutton">{$TEXT_SUBMITCOMMENT}</div>
				<div style="clear:both;"></div>
			</div>			
		{else}
			<div class="commentloginrequired">
				<div class="commentloginmessage">{$TEXT_LOGINCOMMENT}</div>
				<div id="google_loginbutton" class="loginbutton"></div>
                <div id="facebook_loginbutton" class="loginbutton"></div>
                <div id="twitter_loginbutton" class="loginbutton"></div>
                <div id="github_loginbutton" class="loginbutton"></div>
                <div id="bitbucket_loginbutton" class="loginbutton"></div>
			</div>
		{/if}

	</div>
</div>
<form id="deleteCommentForm" method="post" action="#comments">
	<input type="hidden" name="deleteComment" id="deleteComment" value="" />
</form>
